package Day6;

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改
/**
 * 2020JavaB真题:互质
 * https://www.lanqiao.cn/problems/2360/learning/
 */
public class Main3 {
    public static int gcb(int a , int b){
      while(a % b != 0){
        int c = a % b;
        a = b;
        b = c;
      }
      return b;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int count = 0;
        for(int i = 1; i <= 2020; i++){
          if(gcb(i , 1018) == 1){
            count++;
          }
        }
        System.out.println(count);
        scan.close();
    }
}